{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D_title: 正品走珠止汗露夏季男女腋下持久香体露\n",
      "Title: 正品走珠止汗露夏季男女腋下去除异味汗味淡香持久香体露\n",
      "Dsr: 4.8\n",
      "Commission_queqiao: 0.0\n",
      "Quan_receive: 1\n",
      "Quan_price: 15.0\n",
      "Quan_time: 2017-05-18 23:59:59\n",
      "Jihua_link: http://pub.alimama.com/myunion.htm?#!/promo/self/campaign?campaignId=44197491&shopkeeperId=45561508&userNumberId=1730460801\n",
      "Price: 14.0\n",
      "Jihua_shenhe: 0\n",
      "Introduce: 淡香清香止汗露，采用天然花香成分，能快速抑制腋下及脖子汗液分泌，让夏天肌肤清爽清香。\n",
      "Cid: 4\n",
      "Sales_num: 588\n",
      "Quan_link: http://shop.m.taobao.com/shop/coupon.htm?seller_id=1730460801&activity_id=18941c7b2c554419b1c8babf367d0efe\n",
      "IsTmall: 1\n",
      "GoodsID: 547627304373\n",
      "Commission_jihua: 31.0\n",
      "ID: 2428607\n",
      "Que_siteid: 0\n",
      "Commission: 31.0\n",
      "Pic: https://img.alicdn.com/imgextra/i1/1094401577/TB2R5PGmKtTMeFjSZFOXXaTiVXa_!!1094401577.jpg\n",
      "Org_Price: 29.0\n",
      "Quan_m_link: http://dwz.cn/5XqCrE\n",
      "Quan_id: 18941c7b2c554419b1c8babf367d0efe\n",
      "Quan_condition: 29\n",
      "Quan_surplus: 9999\n",
      "SellerID: 1730460801\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "import json\n",
    "url = \"http://api.dataoke.com/index.php?r=Port/index&type=total&appkey=jm24s426ry&v=2&page=1\"\n",
    "r = requests.get(url)\n",
    "data = json.loads(r.content)\n",
    "# data['data'].keys() # [u'update_time', u'api_type', u'total_num', u'update_content']\n",
    "info = data['data']\n",
    "api_type = info['api_type']\n",
    "total_num = info['total_num']\n",
    "update_content = info['update_content']\n",
    "# print update_content\n",
    "# 内容主体\n",
    "result = data['result']\n",
    "\n",
    "result_1 = result[0]\n",
    "# print result_1.keys()   # [u'D_title', u'Title', u'Dsr', u'Commission_queqiao', \n",
    "                        # u'Quan_receive', u'Quan_price', u'Quan_time', u'Jihua_link', u'Price', \n",
    "                        # u'Jihua_shenhe', u'Introduce', u'Cid', u'Sales_num', u'Quan_link', u'IsTmall', \n",
    "                        # u'GoodsID', u'Commission_jihua', u'ID', u'Que_siteid', u'Commission', \n",
    "                        # u'Pic', u'Org_Price', u'Quan_m_link', u'Quan_id', u'Quan_condition', \n",
    "                        # u'Quan_surplus', u'SellerID']\n",
    "\n",
    "for k,v in result_1.items():\n",
    "    print (\"%s: %s\" % (k,v))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
